<extend name="Public/base"/>
<block name="title">体质报告</block>
<block name="location">体质报告列表</block>
<block name="css"></block>
<block name="content">
  <div id="img" style="position: fixed;width: 100%;height: 100%;background-color: rgba(0,0,0,0.3);z-index: 999;visibility: hidden;display: flex;justify-content: center;align-items: center">

  </div>
  <table id="simple-table" class="table  table-bordered table-hover">
    <thead>
    <tr>
      <th class="detail-col">#</th>
      <th>姓名</th>
      <th>性别</th>
      <th>年龄</th>
      <th>身高</th>
      <th>体重</th>
      <th>民族</th>
      <th>所属体质</th>
      <th>家长昵称</th>
      <th>家长电话</th>
      <th>家庭住址</th>
      <th>问卷调查时间</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <volist name="data" id="item" key="k">
      <tr>
        <td class="center">{$k}</td>
        <td>{$item.name}</td>
        <td>{$item.sex}</td>
        <td>{$item.age}</td>
        <td>{$item.height}/cm</td>
        <td>{$item.weight}/kg</td>
        <td>{$item.nation}</td>
        <td>{$item.physique_type}</td>
        <td>{$item.nikename}</td>
        <td>{$item.ptel}</td>
        <td>{$item.address}</td>
        <td>{$item.addtime|date='Y-m-d H:i:s',###}</td>
        <td>
          <div class="hidden-sm hidden-xs btn-group">
            <a class="btn btn-xs btn-warning" href={:U('exportPhysiqueExcel',array('id'=>$item['id']))}>体质导出</a>
          </div>
          <div class="hidden-sm hidden-xs btn-group">
            <a class="btn btn-xs btn-primary" href={:U('exportDietExcel',array('id'=>$item['id']))}>饮食导出</a>
          </div>
          <div class="hidden-sm hidden-xs btn-group">
            <a class="btn btn-xs btn-danger" onclick="showImage('{$item.signature}')">查看签名</a>
          </div>
        </td>
      </tr>
    </volist>
    </tbody>
  </table>
  <div class="row">
    <div class="col-xs-12">
      <div class="dataTables_paginate paging_simple_numbers pages" id="dynamic-table_paginate">
        {$page}
      </div>
    </div>
  </div>
</block>
<block name="js">
  <script>
    const nodes = document.getElementById('img');
    function showImage(img) {
      nodes.innerHTML = `
        <a class="btn btn-xs btn-danger" style="position: absolute;top: 10px;right: 50px" onclick="closeImage()">关闭</a>
        <img src="${img}" style="width: 500px;height: 500px" alt="此报告未签名">
        `;
      nodes.style.visibility = 'visible';
    }
    function closeImage() {
      nodes.style.visibility = 'hidden';
    }
  </script>
</block>
